function main() {
    //1、从url上获取sid
    var sid = getParameter("sid");
    if (!sid){
        alert("必须带上sid")
        return;
    }

    var url = "/api/story-detail.json?sid=" + sid;
    var h1 = document.querySelector("h1");
    var audio = document.querySelector("audio")

    ajax("get",url,function (result) {
        if (!result.success){
            alert(result.reason);
            return;
        }

        var story = result.data;
        h1.innerText = story.name;
        audio.src = story.audio;
    })
}

window.addEventListener("load",main)